#ifndef CORE_ENGINE_H
#define CORE_ENGINE_H

#include <iostream>
#include "ITimer.h"
#include "AssetLoader.h"
#include "InputEventHandler.h"
#include "IRenderer.h"
#include "Syncronize.h"
#include "IPhysicsSimulator.h"

namespace steam
{
	namespace core
	{
		class IEventProcessor;
		class EntityFactory;
		class GameTimer;

		class Engine
		{
		public:

			static Engine& create(int resolution_width = 640, int resolution_height = 480, bool fullscreen = false);
			
			moon::IRenderer& getRenderer();

			const EntityFactory* getEntityFactory() const;

			ITimer& getTimer();

			coal::AssetLoader& getAssetLoader();

			const IEventProcessor* getEventProcessor() const;

			IInputEventHandler& getInputHandler();

			wheel::IPhysicsSimulator& getPhysicsSimulator();

			bool run();

			void pause();

			void destroy();

		private:

			Engine();

			~Engine();

			void init();

			Engine(const Engine& other);

			moon::IRenderer* m_renderer;

			EntityFactory* m_entityFactory;

			GameTimer* m_gameTimer;

			coal::AssetLoader* m_assetLoader;

			IEventProcessor* m_eventProcessor;

			InputEventHandler* m_inputEventHandler;

			wheel::IPhysicsSimulator* m_physicsSimulator;

			bool m_quit;

		};
	}
}

#endif